package lab02.Test11;

/**
 * Created by 李晓容 on 2017/10/24.
 */
public class Square extends Rectangle {
    double L;


    Square(double a, double b) {
        super(a, b);
    }
    public void diagonal(){
        L=Math.sqrt(length*length+width*width);
        System.out.println("对角线："+L);
    }

    public static void main(String[] args) {
    Square S=new Square(4,4);
        System.out.println("正方形");
        S.printMyWay();
        S.diagonal();
    }

}
